<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
		<link href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
		<script src="http://apps.bdimg.com/libs/jquery/1.9.1/jquery.min.js"></script>
	<script src="//cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>

</head>
<body>
<div class="container">
<h2>节点列表</h2>
<form action="{:U('dogrant')}" method="post">
<ul class="list-group">

<foreach name="authlist" item="vo">

  <li class="list-group-item">{$vo.html}<input type="checkbox" <?php if($vo['checked']) echo "checked"; ?> value="{$vo.id}" name="rules[]">{$vo.title} 
  </li>
	</foreach>
	
</ul>
全选：<input type="checkbox"  id="selectAll"/>
	反选：<input type="checkbox"  id="Noselect"/><br>
	<input type="hidden" name="id" value="{$Think.get.id}" />
  <button type="submit" class="btn btn-default">添加</button>
</form>
</div>
<script type="text/javascript">
	$(function(){
		$("#selectAll").click(function(){
			$("form ul input[type='checkbox']").each(function(index, el) {
				if(!el.checked){
					el.checked="checked"
				}
			});
		})
		$("#Noselect").click(function(){
			$("form ul input[type='checkbox']").removeAttr('checked');
		})
	})
</script>
</body>
</html>